package com.tencent.yumeko;

import com.tencent.cloud.polaris.ratelimit.spi.PolarisRateLimiterLabelServletResolver;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
//自定义标签解析器
@Component
public class CustomLabelResolver implements PolarisRateLimiterLabelServletResolver {
    @Override
    public Map<String, String> resolve(HttpServletRequest request) {
        Map<String, String> labels = new HashMap<>();
        labels.put("user", "shanghai");
        return labels;
    }
}
